/*
 * @Description: 年报接口
 * @Author: Zzt
 * @Date: 2022-11-28 12:43:28
 * @LastEditTime: 2023-01-17 21:02:13
 */
import { IPageQuery } from '@/interfaces/global';
import request from '@/utils/request';
export interface IAddAnnualReportParams {
  dataJson?: string;
  name?: string;
  recordTime?: string;
  type?: number;
}
// 新增
export function addAnnualReport(data: IAddAnnualReportParams) {
  return request({
    url: `/annual-report/`,
    method: 'post',
    data
  });
}
export interface IEditAnnualReportParams extends IAddAnnualReportParams {
  id: number;
}
// 修改
export function editAnnualReport(data: IEditAnnualReportParams) {
  return request({
    url: `/annual-report/`,
    method: 'put',
    data
  });
}
// 查询列表
export interface ISearchAnnualReportParams {
  createTime?: string;
  dataJson?: string;
  id?: number;
  name?: string;
  operator?: number;
  operatorName?: string;
  operatorTime?: string;
  recordTime?: string;
  type?: number;
}

export function searchAnnualReport(data: ISearchAnnualReportParams) {
  return request({
    url: `/annual-report/list/`,
    method: 'post',
    data
  });
}

// 分页查询

export function searchAnnualReportByPage(data: IPageQuery<ISearchAnnualReportParams>) {
  return request({
    url: `/annual-report/list/`,
    method: 'post',
    data
  });
}

// 通过id查询

export function findAnnualReportById(id: number | string) {
  return request({
    url: `/annual-report/${id}`,
    method: 'get'
  });
}

// 通过id删除
export function deleteAnnualReportList(id: number | string) {
  return request({
    url: `/annual-report/${id}`,
    method: 'delete'
  });
}
